import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { IsNotEmpty, IsNumber, IsString } from 'class-validator';

export default class HelloDto {
  @IsNumber()
  @ApiProperty({ description: 'id' })
  readonly id: number;

  @IsString()
  @ApiProperty({ description: '名称' })
  @IsNotEmpty({ message: '名称必填' })
  readonly name: string;

  @ApiPropertyOptional({ description: '手机号' })
  readonly phone: string;
}
